package cn.dengta.webapp.trade.dao;

import cn.dengta.common.web.Page;
import cn.dengta.webapp.base.dao.BaseDao;
import cn.dengta.webapp.trade.dto.UserIntegralDTO;
import cn.dengta.webapp.trade.entity.UserIntegral;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 用户积分 Mapper 接口
 *
 * @author yuqidi
 * @since 2022-03-12
 */
public interface UserIntegralDao extends BaseDao<UserIntegral> {

	@Select("SELECT log.*, u.id uId, u.nickname, u.avatar, u.gender, u.agent_id agentId FROM tr_user_integral log JOIN dt_user u ON log.user_id = u.id ${ew.customSqlSegment}")
	Page<UserIntegralDTO> findPage(Page<UserIntegral> page, @Param("ew") QueryWrapper<UserIntegral> wrapper);

}
